package com.perceptivesoftware.licensing.dao.generated;

import com.perceptivesoftware.licensing.domain.generated.*;
import java.util.List;

/**
 * Interface for TwUserprivDAO.
 * 
 * @author MyEclipse Persistence Tools
 */

@SuppressWarnings("unused")
public interface ITwUserprivDAO
{
	/**
	 * Perform an initial save of a previously unsaved TwUserpriv entity. All subsequent persist actions of this entity should use the #update() method. This
	 * operation must be performed within the a database transaction context for the entity's data to be permanently saved to the persistence store, i.e.,
	 * database. This method uses the {@link javax.persistence.EntityManager#persist(Object) EntityManager#persist} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ITwUserprivDAO.save(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            TwUserpriv entity to persist
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void save(TwUserpriv entity);

	/**
	 * Delete a persistent TwUserpriv entity. This operation must be performed within the a database transaction context for the entity's data to be permanently
	 * deleted from the persistence store, i.e., database. This method uses the {@link javax.persistence.EntityManager#remove(Object) EntityManager#delete}
	 * operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ITwUserprivDAO.delete(entity);
	 * EntityManagerHelper.commit();
	 * entity = null;
	 * </pre>
	 * 
	 * @param entity
	 *            TwUserpriv entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void delete(TwUserpriv entity);

	/**
	 * Persist a previously saved TwUserpriv entity and return it or a copy of it to the sender. A copy of the TwUserpriv entity parameter is returned when the
	 * JPA persistence mechanism has not previously been tracking the updated entity. This operation must be performed within the a database transaction context
	 * for the entity's data to be permanently saved to the persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#merge(Object) EntityManager#merge} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * entity = ITwUserprivDAO.update(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            TwUserpriv entity to update
	 * @returns TwUserpriv the persisted TwUserpriv entity instance, may not be the same
	 * @throws RuntimeException
	 *             if the operation fails
	 */
	public TwUserpriv update(TwUserpriv entity);

	public TwUserpriv findById(TwUserprivId id);

	/**
	 * Find all TwUserpriv entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the TwUserpriv property to query
	 * @param value
	 *            the property value to match
	 * @param rowStartIdxAndCount
	 *            Optional int varargs. rowStartIdxAndCount[0] specifies the the row index in the query result-set to begin collecting the results.
	 *            rowStartIdxAndCount[1] specifies the the maximum count of results to return.
	 * @return List<TwUserpriv> found by query
	 */
	public List<TwUserpriv> findByProperty(String propertyName, Object value, int... rowStartIdxAndCount);

	/**
	 * Find all TwUserpriv entities.
	 * 
	 * @param rowStartIdxAndCount
	 *            Optional int varargs. rowStartIdxAndCount[0] specifies the the row index in the query result-set to begin collecting the results.
	 *            rowStartIdxAndCount[1] specifies the the maximum count of results to return.
	 * @return List<TwUserpriv> all TwUserpriv entities
	 */
	public List<TwUserpriv> findAll(int... rowStartIdxAndCount);
}